package moplayer;


public class MoMidiUtils {

	public static String indexize(Integer... args){
		String result = "";
		for (int i = 0; i < args.length; i++) {
			result = result + "#" + args[i];
		}
		return result;
	}
	
	public static int deindexize(String allTogether, int position){
		String[] splited = allTogether.split("#");
		return Integer.parseInt(splited[position + 1]);
	}
	
	public static int getIndex(int[] array, int number){
		int result = -1;
		for (int i = 0; i < array.length; i++) {
			if(array[i] == number){
				result = i;
			}
		}
		return result;
	}
	
	public static int getIndex(String[] array, String indexize) {
		int result = -1;
		for (int i = 0; i < array.length; i++) {
			if(array[i].equals(indexize)){
				result = i;
			}
		}
		return result;
	}
	
}
